package com.white.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyBatisConfig {

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        /*分页拦截器*/
        PaginationInnerInterceptor innerInterceptor = new PaginationInnerInterceptor();
        /*循环*/
        innerInterceptor.setOverflow(true);
        /*设置最大的显示条数*/
        innerInterceptor.setMaxLimit(20L);
        interceptor.addInnerInterceptor(innerInterceptor);
        return interceptor;
    }
}
